﻿@{
    ViewBag.Title = "school";
    Layout = "~/Views/Shared/Error.cshtml";
}

<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2b913d163a572d2dae21461da3d3063e"></script>


<div style="width:100%;height:287px; background:url(../../Content/Images/LearnCenter/studybanner.jpg) no-repeat center top;"></div>

<div class="newteaMain">
    <div class="newsNav">
        <ul class="cen">
        </ul>
    </div>
    </div>

    <h2 class="ntitle nc1">学习中心分布</h2>

    <div class="zt_dt">
        <div id="BaiduMap" style="height:490px; width:1000px;"><img src="~/Content/Images/LearnCenter/mapinit.jpg" /></div>
    </div>

    <div class="nbg stumain hd" id="SchoolList">
        <div class="newSudentMain">

            <h2 class="ntitle nc1">海淀区</h2>
        </div>
        <ul class="zt_list">
            <li>
                <p class="zt_p1"><strong>北京大钟寺学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">北三环西路甲8号院大钟寺中坤广场C座5层</p>
            </li>
            <li class="zt_ml">
                <p class="zt_p1"><strong>公主坟学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">海淀区复兴路47号天行健商务大厦18层1802室 （翠微大厦西）</p>
            </li>
            <li>
                <p class="zt_p1"><strong>世纪城学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">北京市海淀区远大路1号金源时代购物中心5层 </p>
            </li>
            <li class="zt_ml">
                <p class="zt_p1"><strong>牡丹园学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">海淀区花园东路15号旷怡大厦1层 （中兴大厦旁）</p>
            </li>
            <li>
                <p class="zt_p1"><strong>海淀黄庄学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">北京市海淀区海淀黄庄文化艺术大厦B座13层 </p>
            </li>
        </ul>

        <div class="newSudentMain">
            <h2 class="ntitle nc1">朝阳区</h2>
        </div>
        <ul class="zt_list">
            <li>
                <p class="zt_p1"><strong>海淀黄庄学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">北京市海淀区海淀黄庄文化艺术大厦B座13层</p>
            </li>
        </ul>
        <div class="newSudentMain">
            <h2 class="ntitle nc1">东城区</h2>
        </div>
        <ul class="zt_list">
            <li>
                <p class="zt_p1"><strong>北京大兴学习中心</strong><span>010-60211878</span></p>
                <p class="zt_p2">大兴区黄村东大街38号院火神庙国际商业区B座4层北侧</p>
            </li>
            <li class="zt_ml">
                <p class="zt_p1"><strong>牡丹园学习中心</strong><span>400-638-0081</span></p>
                <p class="zt_p2">海淀区花园东路15号旷怡大厦1层 （中兴大厦旁）</p>
            </li>
            <li>
                <p class="zt_p1"><strong>马家堡学习中心</strong><span>010-60211878</span></p>
                <p class="zt_p2">大兴区黄村东大街38号院火神庙国际商业区B座4层北侧</p>
            </li>
        </ul>


    </div>










<div class="env_2Main cen hd">
    <div class=" hd">
        <h2 class="ntitle nc1">学习环境</h2>


        <ul>
            <li>
                <div class="image">
                    <a rel="gallery" title="品牌展示" href="~/Content/Images/LearnCenter/env3.jpg">
                        <img src="~/Content/Images/LearnCenter/env3.jpg">
                        <span><b></b></span>
                    </a>
                    <p>品牌展示</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="教室走廊" href="~/Content/Images/LearnCenter/env4.jpg">
                        <img src="~/Content/Images/LearnCenter/env4.jpg">
                        <span><b></b></span>
                    </a>
                    <p>教室走廊</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="前台咨询" href="~/Content/Images/LearnCenter/env5.jpg">
                        <img src="~/Content/Images/LearnCenter/env5.jpg">
                        <span><b></b></span>
                    </a>
                    <p>前台咨询</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="名人名言" href="~/Content/Images/LearnCenter/env6.jpg">
                        <img src="~/Content/Images/LearnCenter/env6.jpg">
                        <span><b></b></span>
                    </a>
                    <p>名人名言</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="校区一角" href="~/Content/Images/LearnCenter/env7.jpg">
                        <img src="~/Content/Images/LearnCenter/env7.jpg">
                        <span><b></b></span>
                    </a>
                    <p>校区一角</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="全新升级" href="~/Content/Images/LearnCenter/env8.jpg">
                        <img src="~/Content/Images/LearnCenter/env8.jpg">
                        <span><b></b></span>
                    </a>
                    <p>全新升级</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="课程咨询" href="~/Content/Images/LearnCenter/env9.jpg">
                        <img src="~/Content/Images/LearnCenter/env9.jpg">
                        <span><b></b></span>
                    </a>
                    <p>课程咨询</p>
                </div>
            </li>
            <li>
                <div class="image">
                    <a rel="gallery" title="耳目一新" href="~/Content/Images/LearnCenter/env10.jpg">
                        <img src="~/Content/Images/LearnCenter/env10.jpg">
                        <span><b></b></span>
                    </a>
                    <p>耳目一新</p>
                </div>
            </li>


        </ul>




    </div>
</div><!-- News /-->
<script type="text/javascript">
    $(function () {

        //校区LBS Start
        var City = "北京";
        var LBSAPI = "http://i.1smart.org/api/LBS.ashx";
        var LBSShcoolList;
        function jsonpcallback(data) {
        }
        function jsonpcallback2(data) {
        }
        function jsonpcallback3(data) {
        }

        function lbs_InitSchoolList(city) {

            $.ajax({
                type: "get",
                url: LBSAPI,
                dataType: "jsonp",
                jsonp: "callback",
                jsonpCallback: "jsonpcallback2",

                data: {
                    "method": "getschoolbykeyword",
                    "city": escape(city),
                    "region": "",
                    "keyword": ""
                },
                timeout: 20000,
                success: function (data) {
                    if (data.length > 0) {

                        //BindBDMap
                        InitMapMaker(city, "", data);
                        lbs_InitDataList(data);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    console.log(status + textStatus + "；" + errorThrown);
                }
            });
        }

        function lbs_InitDataList(data) {

            var region = {};
            for (var i = 0; i < data.length; i++) {
                (region[data[i]["region"]] == undefined) && (region[data[i]["region"]] = data[i]["region"]);
            }

            $("#SchoolList").empty();
            for (var item in region) {
                $("#SchoolList").append("<div class='newSudentMain'><h2 class='ntitle nc1'>" + item + "</h2></div>");

                var SchoolHtml = "<ul class='zt_list'>";
                $.each(data, function (index) {
                    var school = data[index];
                    if (school.region == item) {
                        SchoolHtml += "<li><p class='zt_p1'><strong>" + school.school + "</strong><span>400-883-8062</span></p><p class='zt_p2'>" + school.address + "</p></li>";
                    }
                })
                SchoolHtml += "</ul>";
                $("#SchoolList").append(SchoolHtml);
            }




        }

        function lbs_InitDefaultCity() {
            lbs_InitSchoolList(City);
        }

        //Init

        lbs_InitDefaultCity();
        //Baidu Map Start ===
        //判定空
        function IsNullOrEmpty(str) {
            if (typeof (str) == "undefined") return true;
            if (str == null) return true;
            if (str == "") return true;
            if (str == "0") return true;
            return false;
        }
        var map;

        //初始化地图
        function InitMapMaker(city, dist, data) {

            //Init Map
            map = new BMap.Map("BaiduMap");
            map.addControl(new BMap.NavigationControl());
            //设置中心点
            var centerLocation;
            if (!IsNullOrEmpty(dist) && !IsNullOrEmpty(city)) {
                centerLocation = city + dist;
                map.centerAndZoom(centerLocation, 10);
            }
            else {
                centerLocation = city;
                map.centerAndZoom(centerLocation, 12);
            }


            $.each(data, function (i, item) {
                add_marker(item["school"], item["address"], item["tel"], item["lng"], item["lat"], "0");
            });
        }

        //标注
        function add_marker(school_name, address, tel, lang, lat, icon_number) {
            var sContent = '<div style="width:300px;"><img src="~/Content/Images/logo.jpg" /><p style="font-size:16px;font-weight:bold">' + school_name + '</p><p style="font-size:13px;">' + address + '</p><p style="font-size:14px;">400-883-8062</p></div>';
            var point = new BMap.Point(lang, lat);  // 创建点坐标
            var myIcon = new BMap.Icon("~/Content/Images/LearnCenter/icon.png", new BMap.Size(18, 24));
            var marker = new BMap.Marker(point, { icon: myIcon });
            var infoWindow = new BMap.InfoWindow(sContent);  // 创建信息窗口对象
            map.addOverlay(marker);
            marker.addEventListener("click", function () {
                this.openInfoWindow(infoWindow);
            });
        }
        //Baidu Map End   ===

        //校区LBS End
    })
</script>

